<div class="bjui-pageContent">
    <fieldset>
        <legend>匹配信息</legend>
        <table class="table table-bordered">
            <tbody>
            <tr>
                <th class="col-sm-2"></th>
                <th class="col-sm-5 text-center">丢失物品</th>
                <th class="col-sm-5 text-center">找到物品</th>
            </tr>
            <tr>
                <td class="col-sm-2 right">名称：</td>
                <td class="col-sm-5">{{$match->lostItem->name}}</td>
                <td class="col-sm-5">{{$match->findItem->name}}</td>
            </tr>
            <tr>
                <td class="right">时间：</td>
                <td>{{$match->lostItem->findLostTime()}}</td>
                <td>{{$match->findItem->findLostTime()}}</td>
            </tr>
            <tr>
                <td class="right">用户：</td>
                <td>{{$match->lostItem->user->name}}</td>
                <td>{{$match->findItem->user->name}}</td>
            </tr>
            <tr>
                <td class="right">分类：</td>
                <td>{{$match->lostItem->p_catalog->name . '-' . $match->lostItem->catalog->name}}</td>
                <td>{{$match->findItem->p_catalog->name . '-' . $match->findItem->catalog->name}}</td>
            </tr>
            <tr>
                <td class="right">详细地址：</td>
                <td>{{$match->lostItem->address()}}</td>
                <td>{{$match->findItem->address()}}</td>
            </tr>
            <tr>
                <td class="right">发布时间：</td>
                <td>{{$match->lostItem->created_at}}</td>
                <td>{{$match->findItem->created_at}}</td>
            </tr>
            <tr>
                <td class="right">期望酬金：</td>
                <td>{{$match->lostItem->wanted_fee}}</td>
                <td>{{$match->findItem->wanted_fee}}</td>
            </tr>
            <tr>
                <td class="right">详细描述：</td>
                <td>{{$match->lostItem->describe}}</td>
                <td>{{$match->findItem->describe}}</td>
            </tr>
            <tr>
                <td class="right">图片：</td>
                <td>
                    @if($images = $match->lostItem->images)
                        <div id="item_images" class="carousel slide" data-ride="carousel">
                            <div class="carousel-inner" role="listbox">
                                @foreach($images as $key => $image)
                                    <div class="item active">
                                        <img src="{{$image->url}}">
                                    </div>
                                @endforeach
                            </div>
                            <a class="left carousel-control" href="#item_images" role="button"
                               data-slide="prev">
                                <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                                <span class="sr-only">Previous</span>
                            </a>
                            <a class="right carousel-control" href="#item_images" role="button"
                               data-slide="next">
                                <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                                <span class="sr-only">Next</span>
                            </a>
                        </div>
                    @endif
                </td>
                <td>
                    @if($images = $match->findItem->images)
                        <div id="item_images" class="carousel slide" data-ride="carousel">
                            <div class="carousel-inner" role="listbox">
                                @foreach($images as $key => $image)
                                    <div class="item active">
                                        <img src="{{$image->url}}">
                                    </div>
                                @endforeach
                            </div>
                            <a class="left carousel-control" href="#item_images" role="button"
                               data-slide="prev">
                                <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                                <span class="sr-only">Previous</span>
                            </a>
                            <a class="right carousel-control" href="#item_images" role="button"
                               data-slide="next">
                                <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                                <span class="sr-only">Next</span>
                            </a>
                        </div>
                    @endif
                </td>
            </tr>
            <tr>
                <td class="right">状态：</td>
                <td class="center" colspan="2"><h5>@if($match->confirm)已@else待@endif确认</h5></td>
            </tr>
            @if($match->confirmUser)
                <tr>
                    <td class="right">操作人：</td>
                    <td class="center" colspan="2"><h5>{{$match->confirmUser->name}}</h5></td>
                </tr>
            @endif
            </tbody>
        </table>
    </fieldset>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li>
            <button type="button" class="btn-close" data-icon="close">关闭</button>
        </li>
        @if(!$match->confirm)
            <li>
                <a href="{{url('/admin/match/confirm/' . $match->id)}}" class="btn btn-primary" data-toggle="doajax"
                   data-type="get">确认匹配</a>
            </li>
        @endif
    </ul>
</div>